package com.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.db.dao.UserDao;
import com.db.entity.User;

@Service
public class UserService {
	
	@Autowired
	private UserDao userDao;
	
	public boolean checkUserName(String username){
		User user = userDao.findByName(username);
		return user==null;
	}
	
	public User getUser(String username){
		return userDao.findByName(username);
	}
	
	public boolean addUser(User user) {
		return userDao.save(user);
	}
	
	
}
